@inject IStringLocalizer<SharedResource> L
<MudMenu AnchorOrigin="Origin.BottomRight"
         Icon="@Icons.Material.Filled.PermIdentity"
         Class="mx-1"
         LockScroll="true"
         TransformOrigin="Origin.TopRight">
    <ChildContent>
        <div class="pb-4"
             style="min-width: 260px;margin-bottom:0px!important">
            <MudCard Elevation="0" Square="true" Style="ma-0">
                <MudCardHeader>
                    <CardHeaderAvatar>
                        @if (string.IsNullOrEmpty(User.Avatar))
                        {
                            <MudAvatar Size="Size.Medium" Color="Color.Primary" Class="ma-2">
                                @User.UserName?.ToUpper().FirstOrDefault()
                            </MudAvatar>
                        }
                        else
                        {
                            <MudAvatar Image="@User.Avatar" />
                        }
                    </CardHeaderAvatar>
                    <CardHeaderContent>
                        <MudText Typo="Typo.body1">@User.DisplayName</MudText>
                        <MudText Typo="Typo.body2">@User.Email</MudText>
                    </CardHeaderContent>
                </MudCardHeader>
            </MudCard>
            <MudDivider Class="my-2" />
            <MudMenuItem Link="/user/profile">
                <div class="d-flex">
                    <MudIcon Class="mx-2"
                             Icon="@Icons.Material.Filled.Person" />
                    <MudText>@L["Profile"]</MudText>
                </div>
            </MudMenuItem>
            <MudMenuItem OnClick="OnSettingClick">
                <div class="d-flex">
                    <MudIcon Class="mx-2"
                             Icon="@Icons.Material.Filled.Settings" />
                    <MudText>@L["Settings"]</MudText>
                </div>
            </MudMenuItem>
            <div class="mt-4 mx-4">
                <MudButton Color="Color.Default"
                           FullWidth="true"
                           StartIcon="@Icons.Material.Filled.Logout"
                           OnClick="OnLogout"
                           Variant="Variant.Outlined">
                    @L["Logout"]
                </MudButton>
            </div>
        </div>
    </ChildContent>
</MudMenu>
